/*-------------------------------------------------------------------------------------------------------------------------
	roleplay commands
-------------------------------------------------------------------------------------------------------------------------*/
local PLUGIN = {}
PLUGIN.Title = "Wanted"
PLUGIN.Description = "Allows arresting on a player."
PLUGIN.Author = "Dr. Matt"
PLUGIN.ChatCommand = "wanted"
PLUGIN.Usage = "<player> [1/0]"

function PLUGIN:Call( ply, args )
	if ply:Team() == 8 then
		local players = evolve:FindPlayer( args, ply, true, true )
		local enabled = ( tonumber( args[ #args ] ) or 1 ) > 0
		if ( #players == 1 ) then
			if enabled then
			players[1].Wanted = true
			evolve:Notify(evolve.colors.blue, players[1]:Nick(), evolve.colors.white, " is now wanted by Police!")
			else
			players[1].Wanted = false
			evolve:Notify(evolve.colors.blue, players[1]:Nick(), evolve.colors.white, " is no longer wanted by Police!")
			end
		elseif ( #players > 1 ) then
			evolve:Notify( ply, evolve.colors.white, "Did you mean ", evolve.colors.red, evolve:CreatePlayerList( players, true ), evolve.colors.white, "?" )
		else
			evolve:Notify( ply, evolve.colors.red, evolve.constants.noplayers )
		end
	else
		evolve:Notify( ply, evolve.colors.red, evolve.constants.notallowed )
	end
end

evolve:RegisterPlugin( PLUGIN )